"""Provides some django extensions to ReST"""
from docutils.core import publish_parts

def markup_parts(value, type):
    # Register the custom directives
    return publish_parts(source=value, 
                         writer_name=type,
                         settings_overrides = {
            'initial_header_level': 2
            })
    
def markup(value, type="html4css1"):
    return markup_parts(value, type)['html_body']


# Register our directives
from pennypress.apps.ReST.directives import django_sidebar, register_directive
register_directive('django-sidebar', django_sidebar)
